1. Field of the Invention
The present invention relates to a processing method of a micro controller. More particularly, the present invention relates to a method for preventing process collision of a micro controller.
2. Description of Related Art
With the result of constant development of technology, the micro controllers (MCU) are applied to many products, such as the embedded controller for detecting computer temperature, the keyboard controller (KBC) for controlling keyboard and interface of personal computer, and the controller for controlling liquid crystal display, etc. Generally, 80-series controllers (8046, 8051 etc) are used for such micro controllers applications.
Generally speaking, micro controllers are usually used for processing some rutine programs, for example, detecting state changes of GPIO pins of a south bridge chip in a computer, detecting battery capacity information through SM bus, detecting temperature and LED indicator light etc. Such rutine programs are usually executed at regular intervals, for example, a keyboard controller executes a 1st program every 5 ms, a 2nd program every 10 ms, a 3rd program every 20 ms, a 4th program every 50 ms, a 5th program every 100 ms, a 6th program every 300 ms, a 7th program every 500 ms, and an 8th program every 1000 ms. However, collisions may happen at common multiples of the intervals of the programs when the foregoing programs are executed, for example, collision of the 1st program and the 2nd program may happen at 10 ms, here the execution of the 1st program having 5 ms period may be delayed.
According to the example described above, at the least common multiple 3000 ms of the periods of all the foregoing programs, collision of all the programs may happen, which will result in delay in the execution of the programs. If it happens to be the first program whose execution is delayed and the time delayed exceeds 5 ms, the system BIOS program will time out or misjudge sequentially, or even worse, system panic may be caused.